import React, { Component } from 'react';
import { render } from 'react-dom';
import {hashHistory, HashRouter, Route} from 'react-router-dom';
import {Messageboard} from './home'
import  EditMessage from './editform'
import {Login} from './login'
import {MessageAll} from './messageall'

class App extends React.Component {
    render() {
        return (
            <div>
                <h1 style={{textAlign:"center",marginTop:20}}>留言系统</h1>
                <Route exact path="/" component={Login} />
                <Route  path="/home/:userName/:id"  component={MessageAll}/>
                <Route path="/message/:userName/:id"  component={Messageboard} />
                <Route path="/edit/:userName/:id"  component={EditMessage} />
            </div>
        );
    }
}
render(
    (<HashRouter>
           <App/>
    </HashRouter>),
    document.getElementById('root')
);